var totalPage;
var type = 0;
var c = require('checkAuthority');
var s = require('selectTransformat');
/*准确查询*/
var total = {
	total: 500
};
search(total);

function search(data) {
	$.ajax({
		type: "post",
		url: "./order/searchorder.bto",
		data: data,
		success: function(data) {
			s.transformatStatus();
			var authorityCode = data.code;

			function template() {
				var myTemplate = __inline('statisticsManage.handlebars');
				$('#table').html(myTemplate(data.other));
			}
			c.authority(authorityCode, template);
		}
	});
}
/*时间搜索*/
$('#statisticSearch button[type=submit]').on('click', function() {
	var start = $('#reservation').val().substring(0, 10).replace(/-/g, '/');
	var end = $('#reservation').val().substring(13).replace(/-/g, '/');
	var status = $('#customsDeclarationStatus').val();
	var formData = {};
	if(start) {
		formData.startDate = start;
		formData.endDate = end;
	}
	if(status) {
		formData.customsDeclarationStatus = status;
	}
	search(formData);
});

$('#print').on('click', function() {
	var printTemplate = __inline('print.handlebars');
	$('#printModel').html(printTemplate);
});